#include<stdio.h>
int main()
{
    int words=0,spaces=0,nums=0,others=0;
    char c=0;
    printf("please enter a sences:");
    while((c=getchar()) !='\n')
    {
        if((c>='a' && c<='z') || (c>='A' && c<='Z'))
        words++;
        else if(c==' ')
        spaces++;
        else if(c>='0' && c<='9')
        nums++;
        else
        others++;
    }
    printf("words=%d\nspaces=%d\nnums=%d\nothers=%d\n",words,spaces,nums,others);
    return 0;

}